﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            //查
            var Select = "select * from Students2";
            using (var reader = DbHelper.DataReader(Select))
            {
                while (reader.Read())
                {
                    Console.WriteLine("{0}\t{1}\t{2}", reader["name"], reader["gender"], reader["score"]);
                }
            }

            //增
            var Insert = string.Format("insert into Students2 (name,gender,score) values ('{0}','{1}','{2}')", "张三", "M", "87");
            DbHelper.Operation(Insert);

            //改
            var Update = string.Format("update Students2 set name = '老胡' where Id = 10");
            DbHelper.Operation(Update);

            //删
            var delete = string.Format("delete from students2 where id=18 ");
            DbHelper.Operation(delete);

        }
    }
}
